package org.sgx.joptest.server;

import org.sgx.dao.ConnectionGiver;
import org.sgx.dao.DaoException;
import org.sgx.dao.JDBCConnectionGiver;

public class PersistenceManager {
private static PersistenceManager instance;

private PersistenceManager() {
}

public static PersistenceManager getInstance() {
	if (instance == null)
		instance = new PersistenceManager();
	return instance;
}

public static ConnectionGiver getValidConnectionGiver() throws DaoException {
	String url = "jdbc:mysql://localhost:3306/";
	String dbName = "daotest1";
	String driver = "com.mysql.jdbc.Driver";
	String userName = "root";
	String password = "root";
	
	return new JDBCConnectionGiver(url, driver, dbName, userName, password);		
}
}
